{template 'include/header'}

<div class="container container-fill">
<script>
window.onload = function() {
    var oDiv = document.getElementById("tab");
    var oLi = oDiv.getElementsByTagName("div")[0].getElementsByTagName("li");
    var aCon = oDiv.getElementsByTagName("div")[2].getElementsByTagName("div");
    var timer = null;
    oLi[0].className="cur";
    aCon[0].className="cur";
    for (var i = 0; i < oLi.length; i++) {
        oLi[i].index = i;
        oLi[i].onclick = function() {
            show(this.index);
        }
    }
    function show(a) {
        index = a;
        var alpha = 0;
        for (var j = 0; j < oLi.length; j++) {
            oLi[j].className = "";
            aCon[j].className = "";
            aCon[j].style.opacity = 0;
            aCon[j].style.display = "none";
            aCon[j].style.filter = "alpha(opacity=0)";
        }
        oLi[index].className = "cur";
        clearInterval(timer);
        timer = setInterval(function() {
            alpha += 2;
            alpha > 100 && (alpha = 100);
            aCon[index].style.opacity = alpha / 100;
            aCon[index].style.display = "block";
            aCon[index].style.filter = "alpha(opacity=" + alpha + ")";
            alpha == 100 && clearInterval(timer);
        },
        5)
    }
}
</script>
<style type='text/css'>
	ul,ol{list-style:none}
	#conPro p,#conPro img,#conPro div,#conPro ul,#conPro li{ width:100% !important;height:auto !important;margin: 0 !important;padding: 0 !important;position: static !important;line-height: 22px !important;;}
#conPro img{padding: 10px 0 !important;height: auto!important;}
	img.avatar{width:40px!important;border-radius: 50%;}
	#tab{position:relative;height:auto;}
	#tab .tabList {height:50px;}
	#tab .tabList ul{padding-left:0;margin: 0;clear:both;}
	#tab .tabList ul li{float:left;padding: 0;width: 45px;text-align: center;margin-left: -1px;position: relative;cursor: pointer;list-style: none;}
	#tab .tabList ul li.cur:after{ content: "";width: 0;height: 0;border-left: 5px solid transparent;border-right: 5px solid transparent;border-bottom: 10px solid #f0efeb;position: absolute;bottom: -12px;left: 20px;z-index: 7;}
	#tab .tabCon{clear: both;border:1px solid #f0efeb;width:100%;height:auto;background-color: #f0efeb;border-radius: 5px;}
	#tab .tabCon div{padding:10px;opacity:0;display: none;height:auto;filter:alpha(opacity=0);}
	#tab .tabList li.cur {border-bottom:none;background:#fff;}
	#tab .tabCon div.cur {opacity:1;display: block;filter:alpha(opacity=100);}
	.right-row {float:right;}
	.right-row span{display: block;width: 20px;height:50px;background: url(<?php echo MODULE_URL;?>template/mobile/img/right_row.png) no-repeat center 10px;background-size: 10px 19px;}
	.respond-list{position: relative;}
	.respond-list:before{content: "";width: 0;height: 0;border-left: 5px solid transparent;border-right: 5px solid transparent;border-bottom: 10px solid #f0efeb;position: absolute;top: -10px;left: 20px;z-index: 100;}
	.gy_d1{width: 100%;height: 46px;background: #fff;border-bottom: 1px solid #e7e7e7;position: fixed;top: 0;left: 0;z-index: 10;}
	.gy_d1l_img{width: 24px;float: left;margin-top: 11px;}
	.gy_d1l_spn{line-height: 46px;}
	.gy_d1l{width: 23%;float: left;margin-left: 2%}
	.gy_d1c{width: 50%;float: left;text-align: center;line-height: 46px;}
	#hear{width: 100%;height: 44px;line-height: 45px;border-bottom: 1px solid #e7e7e7;padding: 0;background: #fff;margin: 0;}
	#hear a{font-weight: normal;color: black;}
	#hear li{text-align: center;float: left;height: 45px;list-style: none;}
	#hear li:nth-of-type(1){width: 25%;float: left;}
	#hear li:nth-of-type(2){width: 25%;float: left;}
	#hear li:nth-of-type(3){width: 25%;float: right;}
	#hear li:nth-of-type(4){width: 25%;float: right;}
	#contentop>li{ width: 100%; display: none;margin: 0 auto;}
	#contentop .action{ display: block;}
	.progress-bar-warning {background-color: #43ac43;}
	.i_d_6{height: 90px;}
	.gy_p1{text-align: left;padding:0 3%}
	.gy_d2{padding:0 3%;position: relative;}
	.gy_d2_d1{float: left;width: 20%;vertical-align: middle;}
	.gy_d2_d1 img{width: 50px;height: 50px;border-radius: 100%;border: 2px solid #43ac43;position: absolute;top: 50%;margin-top: -30px;left: 3%;}
	.gy_d2_d2{float: right;width: 80%;text-align: left;}
	.gy_d2_d2_p1 span{font-size: 12px;color: #999;}
	.sun_dr_d1{width: 100%;margin: 4px 0 4px;height: 100px;overflow: hidden;display: flex;justify-content: center;align-items: center;}
	.sun_dr_d1 img{min-width:100%;max-width:100%;min-height: 100px;}
	.foot{display: block;width: 100%;height: 50px;margin-top: 50px;box-shadow: 1px 1px 2px #666;background-color: #fff;position: fixed;left: 0;bottom: 0;}
	.foot>a{float: left;text-align: center;height: 50px;}
	.foot>a:first-child,.foot a:nth-child(2){width: 15%;font-size: 12px;margin-top: 7px;color: #666}
	.foot>a:last-child{width: 70%}
	.foot>a>.p{padding-top: 4px;}
	.foot>a img{width: auto;height: 20px;}
	.foot>a .jk{width: 90%;height: 36px;border-radius: 10px;margin: 7px auto 0;line-height: 32px;color:#EF0100; overflow: hidden;}
	.foot>a .jk .p{float: left;width: 50%;height: 36px;box-sizing: border-box;-webkit-box-sizing:border-box;}
	.foot>a .jk .p:first-child{border: 2px #EF0100 solid;border-radius: 10px 0 0 10px;}
	.foot>a .jk .p:last-child{background: linear-gradient(to right, #EF0100, rgba(254,141,0,.5));background: -webkit-linear-gradient(to right, #EF0100, rgba(254,141,0,.5));color: #fff; border: none;border-radius: 0 10px 10px 0;line-height: 36px;}
	.buyTip{width: 70%;position: fixed;left: 15%;top: 15%;background-color: #fff;z-index: 9999;border-radius: 10px;}
	.buyTip>img{width: 100%}
	.buyTip .check{padding: 20px 0;text-align: center;color: #666;line-height: 22px;font-size: 12px;}
	.buyTip .check img{width: 18px;height: 18px;margin-right: 5px;}
	.buyTip .btnBuy{width: 100%;text-align: center;}
	.buyTip .btnBuy img{width:60%;padding-bottom: 20px;}
	.buyTip img.closeBuy{width: 20px;height: 20px;position: absolute;right: -20px;top: -20px;}
	.mask1{width: 100%;height: 100%;position: fixed;left: 0;top: 0;z-index: 2001;background-color:rgba(0,0,0,0.8);}
	.tip_yiyuan{width: 90%;position: fixed;left: 5%;top: 20%;background-color: #fff;z-index: 9999;border-radius: 10px;overflow: hidden; }
	.tip_yiyuan .header{width: 45px;height: 45px;position:absolute;left: 15px;top: 35px;border-radius: 100%;overflow: hidden;}
	.tip_yiyuan dt{padding: 30px 15px 30px 75px;position: relative;font-weight: normal;}
	.tip_yiyuan dt .closeTipYiyuan{width: 20px;height: 20px;position: absolute;right: 15px;top: 15px; }
	.tip_yiyuan dt .tip_title{margin-bottom: 3px;padding-left: 15px;}
	.tip_yiyuan dt .tip_con{padding: 15px;background-color: #eee;color: #000;border-radius: 5px;position: relative;}
	.tip_yiyuan dt .tip_con span{color: #F16729;padding-right: 10px;}
	.tip_yiyuan dt .tip_con p{margin: 15px 0 0 0}
	.tip_yiyuan dd .li{width: 50%;height: 50px;background-color: #eee;color: #666;float: left;text-align: center;}
	.tip_yiyuan dd .li:first-child{line-height: 50px;font-size: 14px;}
	.tip_yiyuan dd .li:last-child{background: linear-gradient(to right, #FACD3C, #F16528);color: #fff;font-size: 12px; padding-top: 8px;}
	.u-tri:before{position: absolute;left: -16px;top: 10px;content: '';border-top: 8px solid transparent;border-bottom: 8px solid transparent;border-left: 8px solid transparent;border-right: 8px solid #eee;}
</style>


<!-- 	<div class="i_d_2" style="position:relative; padding-left:10px !important;background:#08070c;">
		<a style="float:left;color:#706d5e;line-height:50px;" href="{php echo $this->createMobileUrl('Welfare');}">每月续捐，让爱不间断</a>
    	<div class="f_r" >
    		<span id="wyyj" style="font-size:14px;color:#08070c;display:inline-block;height: 30px;line-height:30px;margin-top:5px;width:100px;text-align:center;background:gray;border-radius:20px;">我要月捐</span>
    	</div>
     	<div class="clear"></div>
    </div>
 -->
<div class="gy_d1" style="z-index:200;">
	<div class="gy_d1l"><img class="gy_d1l_img" src="<?php echo MODULE_URL;?>/template/mobile/img/gy_l.png"><span class="gy_d1l_spn">返回</span></div>
	<div class="gy_d1c">项目详情</div>
	<div class="clearfix"></div>
</div>
<div style="height:46px;"></div>
<div class="detail-main" style="margin-bottom:10px;">
	<div class="detail-img">
		<img src="{$_W['attachurl']}{$per_pro['pro_feature']}" alt="" />
	</div>
	<div class="detail-div ">
      	<div class="show_div_1" style="margin-bottom:10px; padding:0 !important;">
   			<div class="i_d_6" >
      			<div style="height:35px;padding-top:5px; line-height:30px; position:relative;">
        			<div class="progress float_l" style="height:4px; width:84%;margin-bottom: 0px; margin-top:14px;">
          				<div class="progress-bar progress-bar-warning" role="progressbar" aria-valuenow="{php echo round($per_pro['pro_fund']/$per_pro['pro_goal'],4)*100;}"  aria-valuemin="0" aria-valuemax="100" style="width: {php echo round($per_pro['pro_fund']/$per_pro['pro_goal'],4)*100;}%;"></div>
        			</div>
        			<div class="float_r" style="vertical-align:bottom; width:15%; overflow:hidden; padding-top:0px; text-align:left; padding-right:15px; color:#43ac43;">
        				<span id="bfb_show">{php echo round($per_pro['pro_fund']/$per_pro['pro_goal'],4)*100;}</span>%
        			</div>
        			<div class="clear"></div>
        		</div>
      			<div class="i_d_6_1" style=" border-right:1px solid #ececec;">
      				<div class="float_l i_d_3_1_text1">
      					<span style="color:#d0021b; font-size:16px">{$per_pro['pro_goal']}</span>
     					<div style="margin-top:3px;"> 目标（元）</div>
     				</div>
      				<div class="clear"></div>
      			</div>
      
      			<div class="i_d_6_1" style=" border-right:1px solid #ececec;">
      				<div class="float_l i_d_3_1_text1">
      					<span style="color: #d0021b;font-size:16px">{$per_pro['pro_fund']}</span>
     					<div style="margin-top:3px;"> 已筹款（元）</div>
     				</div>
      				<div class="clear"></div>
      			</div>
      
      			<div class="i_d_6_1" style="">
      				<div class="float_l i_d_3_1_text1">
      					<span style="color:#d0021b;font-size:16px">{$per_count}</span>
     					<div style="margin-top:3px;"> 爱心（份）</div>
    			 	</div>
      				<div class="clear"></div>
      			</div>
    		</div>
        </div>

        <ul id="hear">
			<li class="action" style="border-bottom: 2px solid red;height: 43px;"><a href="javascript:;">项目详情</a></li>
			<li><a href="javascript:;" >发起单位</a></li>
			<li><a href="javascript:;" >信息反馈</a></li>
			<li><a href="javascript:;" >捐款记录</a></li>
		</ul>
		<ul id="contentop" style="padding:10px 0;background:#fff;">
			<li class="action contentop_li">
				<div class="show_div_1" style="margin-bottom:0px; padding:0px 15px 15px 15px;">
		      		<div class='detail-group brief' style="">
		        		<div style=" font-size:12px !important;" id="conPro">
							<?php echo html_entity_decode($per_pro['pro_content']);?>
						</div>
					</div>
					
		      		<div id="comm" class="show_div_1" style="margin-bottom:0px; padding:0px 0 15px 0;">
			      		<div class='detail-group brief' style="">
				      		<div class="i_d_8_1" style="font-size:18px;border-left:none !important; padding-left:0 !important; margin-left:0 !important;margin-top:5px; margin-bottom:0px;border-bottom:1px solid #ececec;overflow:hidden;line-height:35px;">
								<div style="float:left;border-bottom:#f96352 2px solid; width:70px; font-size:16px; ">
					        			爱心留言
					        	</div>
					        	<a href="<?php echo $this->createMobileUrl("comment", array("pro_id"=>$pro_id, "parent_id"=>0))?>"><div style="color:#000;float:right;padding-left:30px;background:url(<?php echo MODULE_URL;?>template/mobile/img/comment.png) no-repeat 0 7px;background-size:26px;font-size:16px;">留言
					        	</div></a>
				      		</div>
				      	</div>
			      		<div id="comment-list">
			      			<!--list-item-->
			      			{loop $com_list $l}
			      			<div class='i_d_5'>
							  	<div class='i_d_5_1' style='height:auto;padding-left:0;padding-right:5px;'>
								    <div class='i_d_5_1_l' style="width:20%">
								    	<img src="{$l['mem_photo']}" style='width:50px;border-radius:50%;float:left;margin-top:0;'>
								    </div>
								    <div style="float:left;width:80%">
										<p style="color:#b1a8a3;margin-bottom:3px">{$l['mem_name']}</p>
								    	<p style='margin-bottom:5px;'>{$l['comment_cont']}</p>
								    	<p style="float:left;color:#b1a8a3;margin-bottom:3px"><?php echo date("Y-m-d H:i:s",$l['time']); ?></p>
								    	<a href="<?php echo $this->createMobileUrl("comment", array("pro_id"=>$pro_id, "parent_id"=>$l['comment_id']));?>"><p style="float:right;padding-left:25px;background:url(<?php echo MODULE_URL;?>template/mobile/img/comment.png) no-repeat 0 -27px;background-size:26px;">回复</p></a>
										<?php if(!empty($l['son_list'])){?>
								    	<div class="respond-list" style="background-color:#f3f2f1;height:auto;clear:both;padding:8px;border-radius:5px">
								    		<p>{loop $l['son_list'] $s}
												<span style="color:#b1a8a3;">{$s['mem_name']}：</span>{$s['comment_cont']}
											</p>{/loop}
								    	</div>
								    	<?php } ?>
								    </div>
								    <div class='clear'></div>
							    </div>
							</div>
							{/loop}
			      		</div>
			      		<div class="show-more" style="margin:0 !important; padding:10px  !important; background:#fff;"><a href="javascript:;" onclick="loadPage('1', 'comment-list')" class="btn btn-default btn-block" id="pager" >查看更多</a></div>
					</div>
		      	</div>
				
			</li>
			<li class="contentop_li">
			   <div class="gy_d2">
			   		<div class="gy_d2_d1"><img src="{$_W['attachurl']}{$per_pro['company_img']}"></div>
			   		<div class="gy_d2_d2">
			   			<p class="gy_d2_d2_p1">接收机构：{$per_pro['company_name']}</p>
			   			<p class="gy_d2_d2_p1">负责人：{$per_pro['name']}</p>
			   			<p class="gy_d2_d2_p1">联系方式：{$per_pro['phone']}</p>
			   		</div>
			   		<div class="clearfix"></div>
			   </div>
			   <p class="gy_p1">单位简介：<span style="font-size:13px;color:#666">{$per_pro['content']}</span></p>
			</li>
			<li class="contentop_li">
				<p style="text-align:center;margin-top:10px;"><?php if(empty($per_pro['pro_gress'])){echo '暂无反馈内容';}else{echo $per_pro['pro_gress'];};?></p>
			</li>
			<li class="contentop_li">
				<div class="detail-div ">
			     	<div class="show_div_1" style="margin-bottom:0px; padding:0px 8px 15px 8px;">
			      		<div id="fund-sort">
			      			<!--list-item-->
			      			{loop $list_arr $row}
			      			<div class='i_d_5'>
							  	<div class='i_d_5_1' style='height:74px'>
								    <div class='i_d_5_1_l w70' style="text-align:left;">
								    <img src="{$row['mem_photo']}" style='width:45px;border-radius:5px;float:left;margin-right:15px'>
										<?php if($set['is_sort']==false) {  ?>
											<p><?php echo mb_substr($row['mem_name'],0,10,'utf-8')?></p>
											<p style='margin-bottom:0px;'><?php echo date('Y-m-d H:i:s',$row['fund_time'])?></p>
										<?php }else{  ?>
											<p style="display: flex;justify-content:center;align-items:Center;"><?php echo mb_substr($row['mem_name'],0,10,'utf-8')?></p>
										<?php } ?>
									</div>
								    <div class='i_d_5_1_r w29' style='text-align:right;'>
								     	<p><span style='color:#fe6903; font-size:16px'>
												<?php if($row['type'] == 'MONEY'){ echo $row['fund_value'];}else{ echo floatval($row['fund_value'])*floatval($set['ratio']);} ?>
												{php if($row['type'] == 'MONEY'){ }元{php }else{ }积分{php }}
										</span></p>
										<?php if($set['is_sort']==false) {  ?>
								     	<p style='margin-bottom:0px;'><span class='i_show_cg' style="background:#43ac43;">捐赠成功</span></p>
										<?php }else{  ?>
										<p style='margin-bottom:0px;'><span class='i_show_cg' style="background:#43ac43;">累计捐赠</span></p>
										<?php } ?>
								    </div>
								    <div class='clear'></div>
							     </div>
							</div>
							{/loop}
			      		</div>
			      		<div class="show-more" style="margin:0 !important; padding:10px  !important; background:#fff;"><a href="javascript:;" onclick="loadPage('1', 'fund-sort')" class="btn btn-default btn-block" id="pager1" >浏览更多</a></div>
					</div>
				</div>
			</li>
		</ul>
		<script>
			$(function(){
				$("#hear li").click(function(){
					$(this).css({
						borderBottom: "2px solid red",
						height:"43px"
					}).siblings().css({
						borderBottom: "none",
						height:"45px"
					});
				});					
				$("#hear li").click(function(){
					$(this).addClass("action").siblings().removeClass("action");
					var index = $(this).index();
					$(".contentop_li").eq(index).css("display","block").siblings().css("display","none");
				});
			});
		</script>

		<div class="foot">
			<a id="openJk" href="{php echo $this->createMobileUrl('Welfare');}"><img src="<?php echo MODULE_URL;?>template/mobile/img/shouye.png"><div class="p">首页</div></a>
			<?php if (time()>$per_pro['starttime'] && time()<$per_pro['endtime']) {?>
			<?php if (empty($_W['fans']['follow']) && $set['is_follow']==true) {?>
				<a href="<?php echo $this->createMobileUrl("invite",array("pro_id"=>$pro_id));?>" id="see_sort_btn"><img src="<?php echo MODULE_URL;?>template/mobile/img/yiqijuan.png"><div class="p">一起捐</div></a>
				<a><div class="jk"><div class="p"  id="guanzhu">请点击关注并捐款</div>
			<?php}elseif($per_pro['pro_uber']=='0'&& $per_pro['pro_fund']>=$per_pro['pro_goal'] ){ ?>
				<a onclick='yqz("捐款已结束")' id="see_sort_btn"><img src="<?php echo MODULE_URL;?>template/mobile/img/yiqijuan.png"><div class="p">一起捐</div></a>
				<a><div class="jk"><div class="p">捐款已结束</div>
			<?php }else{?>
				<a href="<?php echo $this->createMobileUrl("invite",array("pro_id"=>$pro_id));?>" id="see_sort_btn"><img src="<?php echo MODULE_URL;?>template/mobile/img/yiqijuan.png"><div class="p">一起捐</div></a>
				<a><div class="jk"><div class="p" id="wyjk">立即捐款</div>
			<?php}?>
			<?php}elseif(time()<$per_pro['starttime']){?>
				<a onclick='yqz("捐款未开始")' id="see_sort_btn"><img src="<?php echo MODULE_URL;?>template/mobile/img/yiqijuan.png"><div class="p">一起捐</div></a>
				<a><div class="jk"><div class="p">捐款未开始</div>
			<?php}else{?>
				<a onclick='yqz("捐款已结束")' id="see_sort_btn"><img src="<?php echo MODULE_URL;?>template/mobile/img/yiqijuan.png"><div class="p">一起捐</div></a>
				<a><div class="jk"><div class="p">捐款已结束</div>
			<?php}?>
			<div class="p" id="buyJk">购买捐赠</div></div></a>
		</div>

		<div class="mask1" style="display: none"></div>
		<div class="buyTip" style="display: none">
			<img src="<?php echo MODULE_URL;?>/template/mobile/img/xw.png" class="closeBuy">
			<img src="<?php echo MODULE_URL;?>template/mobile/img/buyTip.png">
			<div class="check"><img src="<?php echo MODULE_URL;?>template/mobile/img/check.png" id="check"><span>我知晓购买捐赠规则</span></div>
			<div class="btnBuy"><img src="<?php echo MODULE_URL;?>template/mobile/img/btnBuy1.png"></div>
		</div>
		<dl class="tip_yiyuan" style="display: none">
			<img src="{$my_name['mem_photo']}" class="header">
			<dt>
				<img src="<?php echo MODULE_URL;?>template/mobile/img/x.png" class="closeTipYiyuan">
				<div class="tip_title">筹款发起人</div>
				<div class="tip_con u-tri"><span>@{$my_name['mem_name']}</span>谢谢你的关注
					<p>您的爱心将帮助我们把温暖带去给需要的人</p>
				</div>
			</dt>
			<dd>
				<div class="li" id="goIndex">直接离开</div>
				<div class="li" id="jkyy">资助1元<br/>为义工队伍添砖加瓦</div>
			</dd>
		</dl>
<!--		<div class="i_d_10" style="border-top:#ececec 1px solid;z-index:1000;">-->
<!--		<?php if (time()>$per_pro['starttime'] && time()<$per_pro['endtime']) {?>-->
<!--			<?php if (empty($_W['fans']['follow']) && $set['is_follow']==true) {?>-->
<!--				<div class="i_d_10_1 btn btn-danger  btn-block" id="guanzhu" style="background:#f96352; border-color:#f96352; color:#fff;">-->
<!--	       			请点击关注并捐款-->
<!--	       		</div>-->
<!--			<?php}elseif($per_pro['pro_uber']=='0'&& $per_pro['pro_fund']>=$per_pro['pro_goal'] ){ ?>-->
<!--			    <div class="i_d_10_1 btn btn-danger  btn-block" style="background:#f96352; border-color:#f96352; color:#fff;width:48%;float:left;">-->
<!--	       			捐款已结束-->
<!--	       		</div>-->
<!--			<?php }else{?>-->
<!--	       		<div class="i_d_10_1 btn btn-danger  btn-block" id="wyjk" style="background:#f96352; border-color:#f96352; color:#fff;">-->
<!--	       			立即捐款-->
<!--	       		</div>-->
<!--	       	<?php}?>-->
<!--       	<?php}elseif(time()<$per_pro['starttime']){?>-->
<!--       			<div class="i_d_10_1 btn btn-danger  btn-block" style="background:#f96352; border-color:#f96352; color:#fff;width:48%;float:left;">-->
<!--	       			捐款未开始-->
<!--	       		</div>-->
<!--       	<?php}else{?>-->
<!--				<div class="i_d_10_1 btn btn-danger  btn-block" style="background:#f96352; border-color:#f96352; color:#fff;width:48%;float:left;">-->
<!--	       			捐款已结束-->
<!--	       		</div>-->
<!--       	<?php}?>-->
<!--       		<a href="<?php echo $this->createMobileUrl("invite",array("pro_id"=>$pro_id));?>" class="i_d_10_1 btn btn-danger btn-block" id="see_sort_btn" style="background-color:#43ac43; border-color:#43ac43; color:#fff;">-->
<!--       			邀请朋友一起捐-->
<!--       		</a>-->
<!--       		<div style="clear:both;"></div>-->

<!--    	</div>-->
      	<!--金额弹窗-->
      	
    	<div class="jetc" id="day-donate" style="border-top:#ececec 1px solid; padding:10px 15px !important;z-index:1001;">
    	{if $set['type'] == 'MIXTURE'}
      	<ul class="change-tab">
      		<li class="to-credit">积分捐</li>
      		<li class="to-money active">现金捐</li>
      	</ul>
      	{/if}
    		{if $set['type'] !== 'CREDIT'}
    		<div class="money-input">

			<div class="float_l">
                <div class="input_2 input_val5"  style="position:relative;"><span class="font_2"><?php if($set['cash1']){echo $set['cash1'];}else{echo '5';} ?></span>元
                    <div style="position:absolute; right:0; bottom:0;" class="arrow-left"></div>
                    <div class="gou_b"><span class="glyphicon glyphicon-ok" aria-hidden="true"></span></div>
                </div>
            </div>
            <div class="float_l">
                <div class="input_2 input_val10"  style="position:relative;"><span class="font_2"><?php if($set['cash2']){echo $set['cash2'];}else{echo '10';} ?></span>元
                    <div style="position:absolute; right:0; bottom:0;" class="arrow-left"></div>
                    <div class="gou_b"><span class="glyphicon glyphicon-ok" aria-hidden="true"></span></div>
                </div>
            </div>
            <div class="float_l">
                <div class="input_2 input_val50"  style="position:relative;"><span class="font_2"><?php if($set['cash3']){echo $set['cash3'];}else{echo '50';} ?></span>元
                    <div style="position:absolute; right:0; bottom:0;" class="arrow-left"></div>
                    <div class="gou_b"><span class="glyphicon glyphicon-ok" aria-hidden="true"></span></div>
                </div>
            </div>
            <div class="float_l">
                <div class="input_2 input_val100"  style="position:relative;"><span class="font_2"><?php if($set['cash4']){echo $set['cash4'];}else{echo '100';} ?></span>元
                    <div style="position:absolute; right:0; bottom:0;" class="arrow-left"></div>
                    <div class="gou_b"><span class="glyphicon glyphicon-ok" aria-hidden="true"></span></div>
                </div>
            </div>

    	    <div class="float_l" style="width:100%;">
    	    	<div class="input_1" style="position:relative;">
    	    		<input name="price" value="" size="6" class="price_input input_2 font_3" placeholder="输入金额，爱心无价" style="width:90%; padding:7px 30px 7px 10px; font-size:14px; color:#43ac43; "/>
    	    		<span style="display:inline-block; margin-left:-30px;font-size:12px; color:#939393;">元</span>
    			</div>
    			
    			<a href="javascript:void(0)" id="price">
    				<span style="float:right;color:#fff; display:none;background:#43ac43 !important;">立即捐助<i class="glyphicon glyphicon-chevron-right"></i></span>
    			</a>
    		</div> 	
			<label style="display:none;" id="jine"></label>
			<div class="clear"></div>
     		<a href="###" id="jk_btn" >
     			<div class="btn btn-danger  btn-block" style="background:#43ac43; border-color:#43ac43; color:#fff;">立即捐款</div>
     		</a>
			</div>
			{/if}
			{if $set['type'] !== 'MONEY'}
			<div class="credit-input">
				<!-- <div class="float_l" style="width:100%;">
	    	    	<div class="input_1" style="position:relative;">
	    	    		<input name="credit" value="" size="6" class="credit_input input_2 font_3" placeholder="输入积分" style="width:90%; padding:7px 30px 7px 10px; font-size:14px; color:#43ac43; "/>
	    	    		<span style="display:inline-block; margin-left:-30px;font-size:12px; color:#939393;"></span>
	    			</div>
    				<p>您的剩余积分：{$credit}</p>
	    			<a href="javascript:void(0)" id="credit">
	    				<span style="float:right;color:#fff; display:none;background:#43ac43 !important;">立即捐助<i class="glyphicon glyphicon-chevron-right"></i></span>
	    			</a>
    			</div>  -->
    			<div class="clear"></div>
	     		<a href="###" id="credit_btn" >
	     			<div class="btn btn-danger  btn-block" style="background:#43ac43; border-color:#43ac43; color:#fff;">立即捐款</div>
	     		</a>
    		</div>
			{/if}
     		
     		<div class="has-success i_d_14">
      			<div class="radio">
        			<label>
          				<input type="radio" id="checkboxSuccess" value="option1"  checked style=" margin-top:2px;">
          					同意并接受<a href="{php echo $this->createMobileUrl('agree')}">{$set['gy_agree_name']}</a>
        			</label>
      			</div>
   			</div>
		</div>
 		<!--遮蔽层-->
 		<!--金额弹窗-->
    	<div class="jetc" id="month-donate" style="border-top:#ececec 1px solid; padding:10px 15px !important;z-index:1001;">
    		<div class="float_l">每月自动提醒你续捐，爱是一种习惯！</div><div style="clear:both;"></div>
    		
		    <div class="float_l">
                <div class="input_2 input_val5"  style="position:relative;"><span class="font_2"><?php if($set['cash1']){echo $set['cash1'];}else{echo '5';} ?></span>元
                    <div style="position:absolute; right:0; bottom:0;" class="arrow-left"></div>
                    <div class="gou_b"><span class="glyphicon glyphicon-ok" aria-hidden="true"></span></div>
                </div>
            </div>
            <div class="float_l">
                <div class="input_2 input_val10"  style="position:relative;"><span class="font_2"><?php if($set['cash2']){echo $set['cash2'];}else{echo '10';} ?></span>元
                    <div style="position:absolute; right:0; bottom:0;" class="arrow-left"></div>
                    <div class="gou_b"><span class="glyphicon glyphicon-ok" aria-hidden="true"></span></div>
                </div>
            </div>
            <div class="float_l">
                <div class="input_2 input_val50"  style="position:relative;"><span class="font_2"><?php if($set['cash3']){echo $set['cash3'];}else{echo '50';} ?></span>元
                    <div style="position:absolute; right:0; bottom:0;" class="arrow-left"></div>
                    <div class="gou_b"><span class="glyphicon glyphicon-ok" aria-hidden="true"></span></div>
                </div>
            </div>
            <div class="float_l">
                <div class="input_2 input_val100"  style="position:relative;"><span class="font_2"><?php if($set['cash4']){echo $set['cash4'];}else{echo '100';} ?></span>元
                    <div style="position:absolute; right:0; bottom:0;" class="arrow-left"></div>
                    <div class="gou_b"><span class="glyphicon glyphicon-ok" aria-hidden="true"></span></div>
                </div>
            </div>

    	    <div class="float_l" style="width:100%;">
    	    	<div class="input_1" style="position:relative;">
    	    		<input name="price" value="" size="6" id="price-input" class="price_input input_2 font_3" placeholder="输入金额，爱心无价" style="width:90%; padding:7px 30px 7px 10px; font-size:14px; color:#43ac43; "/>
    	    		<span style="display:inline-block; margin-left:-30px;font-size:12px; color:#939393;">元</span>
    			</div>
    			
    			<a href="javascript:void(0)" id="price">
    				<span style="float:right;color:#fff; display:none;background:#43ac43 !important;">立即捐助<i class="glyphicon glyphicon-chevron-right"></i></span>
    			</a>
    		</div> 	
			<label style="display:none;" id="jine"></label>
     		<div class="clear"></div>
     		<a href="###" id="yj_btn" >
     			<div class="btn btn-danger  btn-block" style="background:#43ac43; border-color:#43ac43; color:#fff;">每月提醒你捐款</div>
     		</a>
     		<div class="has-success i_d_14">
      			<div class="radio">
        			<label>
          				<input type="radio" id="checkboxSuccess" value="option1"  checked style=" margin-top:2px;">
          					同意并接受<a href="{php echo $this->createMobileUrl('agree')}">{$set['gy_agree_name']}</a>
        			</label>
      			</div>
   			</div>
		</div>
 		<!--遮蔽层-->
    	<div class="mask"></div>
	</div>
	<!--分享层-->
	<div class="chuandi">
		<img src="<?php echo MODULE_URL;?>/template/mobile/img/love.png">
		<div class="mask"></div>
	</div>
	<script type="text/javascript">
		function yqz(e){//捐款状态提示
			layer.open({content: e,skin: 'msg',time: 2});
		}
	 	$("#price").click(
	 		function(){
				var  price = $('.price_input').val();
				window.location.href = "{php echo $this->createMobileUrl('donate',array('pro_id'=>$per_pro['pro_id']));}&price="+price;
		 });
	 	// $("#credit_btn").click(
	 	// 	function(){
			// 	var  credit = $('.credit_input').val();
			// 	var mycredit = "<?php echo $credit;?>";
			// 	if(credit == '' || credit == 0) {alert("积分不能为零或未输入");}
			// 	else if(credit > parseFloat(mycredit)) {
			// 		alert("积分不足或者未输入");
			// 	} 

			// 	else {
			// 		window.location.href = "{php echo $this->createMobileUrl('credit',array('pro_id'=>$per_pro['pro_id']));}&price="+credit;
			// 	}
		 // });
	</script>
	<script type="text/javascript">
		function loadPage(pindex, container) {
			if(container=='fund-sort'){
				pindex = parseInt(pindex) + 1;
				$('#pager1').html('正在加载数据...');
				$.get("{php echo $this->createMobileUrl('sort',array('pro_id'=>$pro_id));}", {'page' : pindex}, function(html){
					if(html!==""){
						$('#'+container).append(html);
						$('#pager1').get(0).onclick = function(){
							loadPage(pindex, container);
						}
						$('#pager1').html("浏览更多");
					}else{ 
						$('#pager1').html("已经显示全部");
					}
				});
			}else{
				pindex = parseInt(pindex) + 1;
				$('#pager').html('正在加载数据...');
				$.get("{php echo $this->createMobileUrl('morecomment',array('pro_id'=>$pro_id));}", {'page' : pindex}, function(html){
					if(html!==""){
						$('#'+container).append(html);
						$('#pager').get(0).onclick = function(){
							loadPage(pindex, container);
						}
						$('#pager').html("浏览更多");
					}else{ 
						$('#pager').html("已经显示全部");
					}
				});
			}			
		}
	</script>
	<script>
	 	function changeTwoDecimal_f(x) {
		    var f_x = parseFloat(x);
		    if (isNaN(f_x)) {
		        alert('function:changeTwoDecimal->parameter error');
		        return false;
		    }
	    	var f_x = Math.round(x * 100) / 100;
	    	var s_x = f_x.toString();
	    	var pos_decimal = s_x.indexOf('.');
		    if (pos_decimal < 0) {
		        pos_decimal = s_x.length;
		        s_x += '.';
		    }
		    while (s_x.length <= pos_decimal + 2) {
		        s_x += '0';
		    }
	    	return s_x;
		}
 		
     	$("#wyjk").click(
	 		function(){
		 		$("#day-donate").show();
		 		$(".mask").show();
		 	}
		);
		$("#wyyj").click(
	 		function(){
		 		$("#month-donate").show();
		 		$(".mask").show();
		 	}
		);
		$("#yao_btn").click(
	 		function(){
		 		$(".chuandi").show();
		 		$(".mask").show();
		 	}
		);
	 	$("#guanzhu").click(
	 		function(){
				window.location.href = "{$set['follow_url']}";
		 	}
		);
		$(".mask").click(
		 	function(){
			 	$(".jetc").hide();
			 	$(".mask").hide();
			 	$('.price_input').val("");
			 }
		);
		$(".input_2").click(
			function(){
				$(".input_2").css("border-color","#ccc"); 
				$(".input_2").css("border-width","1px");
				$(this).css("border-color","#43ac43");
				$(this).css("border-width","2px");
				$(".input_2").find(".arrow-left").hide();
				$(".input_2").find(".gou_b").hide();
				$(this).find(".arrow-left").show();
				$(this).find(".gou_b").show();
				$("#price_input").val("");
		 	}
		);
		$(".input_val5").click(
            function(){             	
                $(".price_input").val($(this).find('.font_2').html());
            }
        );
        $(".input_val10").click(
            function(){ 
                $(".price_input").val($(this).find('.font_2').html());
            }
        );
        $(".input_val50").click(
            function(){ 
                $(".price_input").val($(this).find('.font_2').html());
            }
        );
        $(".input_val100").click(
            function(){ 
                $(".price_input").val($(this).find('.font_2').html());
            }
        );
		$("#jk_btn").click(
	 		function(){
	   			if(parseFloat($(".price_input").val())>0){
					$("#price").click();
				} else {
         			alert("捐点爱心吧！");
				}
		 	}
		);	
		$("#yj_btn").click(
	 		function(){
	   			if(parseFloat($("#price-input").val())>0){
					var  price = $('#price-input').val();
					window.location.href = "{php echo $this->createMobileUrl('donate',array('pro_id'=>$per_pro['pro_id']));}&ch=month&price="+price;
				} else {
         			alert("捐点爱心吧！");
				}
		 	}
		);
		$("#buyJk").click(function () {
			$(".buyTip").addClass('animated bounceInDown').show();
			$(".mask1").show();
			$(".mask1,.closeBuy").click(function () {
				$(".buyTip").addClass('animated bounceOutDown');
				setTimeout(function () {
					$(".buyTip").removeClass('bounceOutDown').hide();
					$(".tip_yiyuan").hide();
					$(".mask1").hide();
				},500)
			});
		});

		$(".gy_d1l").click(function () {
			$(".tip_yiyuan").addClass('animated bounceInDown').show();
			$(".mask1").show();
			$(".mask1,.closeTipYiyuan").click(function () {
				$(".tip_yiyuan").addClass('animated bounceOutDown');
				setTimeout(function () {
					$(".tip_yiyuan").removeClass('bounceOutDown').hide();
					$(".mask1").hide();
				},500)
			});
			$("#jkyy").click(function() {
				$("#day-donate").show();
				$(".price_input ").val(1);
				$(".mask").show();

				$(".tip_yiyuan").addClass('animated bounceOutDown');
				setTimeout(function () {
					$(".tip_yiyuan").removeClass('bounceOutDown').hide();
					$(".mask1").hide();
				},500)
			});
		});
		$("#goIndex").click(function () {
			window.location.href="{php echo $this->createMobileUrl('Welfare');}";
		});

		$("#check").click(function(){
			var checked="<?php echo MODULE_URL;?>template/mobile/img/checked.png";
			var btnBuy2="<?php echo MODULE_URL;?>template/mobile/img/btnBuy2.png";
			$("#check").attr("src",checked);
			$(".btnBuy img").attr("src",btnBuy2);
			$(".btnBuy").addClass("goBuy");
			$(".btnBuy.goBuy").click(function(){
				layer.open({content: '慈善超市还没开放',skin: 'msg',time: 2});
			});
		});


    </script>
    <script>
    $('.change-tab li').click(function(){
    	$(this).addClass('active').siblings().removeClass('active');
    	if($(this).hasClass('to-money')) {
    		$('.money-input').css('display','block');
    		$('.credit-input').css('display','none');
    	}
    	if($(this).hasClass('to-credit')) {
    		$('.credit-input').css('display','block');
    		$('.money-input').css('display','none');
    	}
    });
    $('.change-tab li.to-credit').click();
    </script>


	<?php if(!empty($adv)) {?>
	<div class="adv" style="width:100%;text-align:center;">
		<div style="margin:0;position:relative;">
			<span id="adv_close" style="display:inline-block;color:#fff;width:18px;height:18px;border-radius:50%;background-color:rgba(216,214,214,.6);position:absolute;right:1px;top:1px;cursor:pointer">X</span>
			<a href="{$adv['adv_link']}"><div class="sun_dr_d1"><img alt="{$adv['adv_title']}" src="{$_W['attachurl']}{$adv['adv_pic']}"></div></a>
		</div>
	</div>
	<?php } ?>


	{template 'include/footer'}
</div>
   
	{php echo register_jssdk(false);}
<script type="text/javascript">
    initShare();
    function initShare(){
        wx.ready(function () {
            sharedata = {
                title: "{$per_pro['pro_name']}",
                desc: "{$per_pro['pro_short']}",
                link: window.location.href,
                imgUrl: "{$_W['attachurl']}{$per_pro['pro_feature']}",
                success: function(){

                },
                cancel: function(){
                    //alert("分享失败，可能是网络问题，一会儿再试试？");
                }
            };
            <?php if(!empty($_share)){?>
	            sharedata = {
	                title: "{$_share['title']}",
	                desc: "{$_share['content']}",
	                link: "{$_share['link']}",
	                imgUrl: "{$_W['attachurl']}{$_share['imgUrl']}",
	                success: function(){

	                },
	                cancel: function(){
	                    //alert("分享失败，可能是网络问题，一会儿再试试？");
	                }
	            };
            <?php }?>
            wx.onMenuShareAppMessage(sharedata);
            wx.onMenuShareTimeline(sharedata);
        });
    }
</script>
    <div style="height:50px;"></div>
</body>
</html>
